package com.woniu.new_orange.customization_model_zhang.controller;

import com.woniu.new_orange.customization_model_zhang.service.RecommendService;
import com.woniu.new_orange.entity.FinalOrder;
import com.woniu.new_orange.entity.OrderForm;
import com.woniu.new_orange.entity.PushLevel;
import com.woniu.new_orange.entity.Recommend;
import com.woniu.new_orange.finance_model_guo.Dto.RefundDto;
import com.woniu.new_orange.finance_model_guo.Vo.RefundRecordVo;
import com.woniu.new_orange.finance_model_guo.service.PushLevelService;
import com.woniu.new_orange.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Program: new_orange->RecommendController
 * @Description:
 * @Author: 谭少琛的爸爸
 * @Date: 2023-02-09 15:20
 * @Version： 1.0
 **/
@RestController
@RequestMapping("rec")
public class RecommendController {
    @Autowired
    private RecommendService recommendService;
    @Resource
    private PushLevelService pushLevelService;
    @GetMapping("{id}")
    public Result add1(@PathVariable long id){
        PushLevel pushLevel = pushLevelService.selectByPrimaryKey(id);
        Recommend recommend = new Recommend();
        String pushLevelName = pushLevel.getPushLevelName();
        String pushLevelDesc = pushLevel.getPushLevelDesc();
        recommend.setRecommendName(pushLevelName);
        recommend.setRecommendDesc(pushLevelDesc);
        int i = recommendService.insertSelective(recommend);
//        OrderForm orderForm = orderFormService.selectByPrimaryKey(id);
//        FinalOrder finalOrder = new FinalOrder();
//        String orderFormNo = orderForm.getOrderFormNo();
//        finalOrder.setFinalOrderNo(orderFormNo);
//        Integer orderFormId = orderForm.getOrderFormId();
//        Date orderFormDate = orderForm.getOrderFormDate();
//        BigDecimal orderFormBudget = orderForm.getOrderFormBudget();
//        finalOrder.setOrderFormId(orderFormId);
//        finalOrder.setFinalOrderCreateTime(orderFormDate);
//        finalOrder.setFinalOrderActualPayment(orderFormBudget);
//        finallyOrderService.insertSelective(finalOrder);
//        return  Result.ok();
        return  Result.ok();
    }
}
